package com.yootk;
public class YootkDemo7 {
    public static void main(String[] args) throws Exception {
        Account account = new Account("李兴华", 0);
        int money[] = new int[] { 110, 230, 10_000 };
        for (int x = 0; x < 10; x++) {
            if (x % 2 == 0) {
                new Thread(() -> {
                    for (int y = 0; y < money.length; y++) {
                        account.save(money[y]);
                    }
                }, "存款者 - " + x).start();
            } else {
                new Thread(() -> {
                    while (true) {
                        System.out.println(account);
                    }
                }, "查询者 - " + x).start();
            }
        }
    }
}